INCLUDE(CheckCXXSymbolExists)

CHECK_CXX_SYMBOL_EXISTS("__MINGW32__" "" IS_MINGW)
IF(IS_MINGW)
    ADD_DEFINITIONS("-mwindows")
    SET(PLATFORM_SPECIFIC_LIBS mingw32)
ENDIF()

ADD_DEFINITIONS(${SIMD_FLAGS})

INCLUDE_DIRECTORIES(${CARINA_ENGINE_INCLUDE_DIRS}
                    ${Boost_INCLUDE_DIRS})

IF(${CMAKE_SYSTEM_NAME} MATCHES "Android")
    SET(DEMO_SRC android-demo.cc)
ELSE()
    SET(DEMO_SRC pc-demo.cc)
ENDIF()

ADD_EXECUTABLE(carina WIN32 ${DEMO_SRC})

TARGET_LINK_LIBRARIES(carina carina_engine ${PLATFORM_SPECIFIC_LIBS} ${CARINA_DEBUG_LIBRARIES})

INSTALL(TARGETS carina DESTINATION bin)
